Embedded graphics coding for images with sparse histograms

ABSTRACT

Processes for compressing images with sparse histograms are disclosed. The image is divided into blocks, and a bit budget is assigned for each block. The pixels of a block are converted and coded bit-plane by bit-plane, starting from the Most Significant Bit (MSB) and going towards the Least Significant Bit (LSB). The pixels of the block are partitioned into groups. Each group contains pixels that have same value. Moving from the MSB to the LSB, the groups in each bit-plane are processed. When processing a group, the encoder sends a “0” if all group members have same bit value at the current bit-plane being processed, followed by the bit value; otherwise, the encoder sends a “1”, followed by refinement bits for each pixel of the group, and the encoder splits the group.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority from U.S. Provisional Application Ser.No. 61/185,557, filed on Jun. 9, 2009, and entitled, “Embedded GraphicsCoding for Images with Sparse Histograms,” which is incorporated hereinby reference in its entirety.

NOTICE OF MATERIAL SUBJECT TO COPYRIGHT PROTECTION

A portion of the material in this patent document is subject tocopyright protection under the copyright laws of the United States andof other countries. The owner of the copyright rights has no objectionto the facsimile reproduction by anyone of the patent document or thepatent disclosure, as it appears in the United States Patent andTrademark Office publicly available file or records, but otherwisereserves all copyright rights whatsoever. The copyright owner does nothereby waive any of its rights to have this patent document maintainedin secrecy, including without limitation its rights pursuant to 37C.F.R. §1.14.

FIELD OF THE INVENTION

This invention pertains generally to data compression, and moreparticularly to data compression for images with sparse histograms.

BACKGROUND OF THE INVENTION

Most image compression schemes are designed for “natural images”, e.g.photos taken by a digital camera. For natural images, strong correlationexists among neighboring pixels. Hence, most image compression schemeswork by de-correlating the pixels using prediction/transform, or both.This results in a sparse histogram of the prediction residuals ortransform coefficients. FIG. 1 illustrates histogram 12 of an image 10after an 8×8 discrete cosine transform 16. As shown in FIG. 1, thehistogram 12 has a single peak 14, which is located around 0.Quantization is applied (if necessary), and entropy coding of the(quantized) prediction residuals or transform coefficients is performed.The entropy coder is generally designed for distributions similar tothose shown in FIG. 1. In other words, if the distribution hassignificantly different shape, the coding performance could be poor.

However, there is also a large amount of “unnatural” images in need ofcompression. These images often comprise graphics or text, whichtypically have a large dynamic range strong contrast, sharp edges,strong textures, and sparse histograms. FIG. 2 is an example of such an“unnatural image”.

These types of images usually cannot be well handled by conventionalimage compression algorithms. Inter-pixel correlation is weaker, andprediction or transform does not provide a sparse distribution as fornatural images.

One attempt to address compression of these images is called “histogrampacking”, where the encoder goes through the whole image, computes thehistogram, and does a non-linear mapping of the pixels beforecompressing the image. The compression requires a two-pass processing,causing increased memory cost and more computations. The bitstream isnot scalable, which means that the decoder needs the whole bitstream todecode the image. Partial reconstruction is not possible withoutre-encoding.

SUMMARY OF THE INVENTION

Processes for compressing images with sparse histograms are disclosed.The image is divided into blocks, and a bit budget is assigned for eachblock. The pixels of a block are converted and coded bit-plane bybit-plane, starting from the Most Significant Bit-plane (MSB) and goingtowards the Least Significant Bit-plane (LSB). The pixels of the blockare partitioned into groups. Each group contains pixels that have thesame value. A group is split, if pixels in the group have differentvalues in the bit-plane being encoded. Moving from the MSB to the LSB,the groups in each bit-plane are processed. The encoder sends a “0” fora group if all members of the group have same bit value at the currentbit-plane being processed, followed by the bit value. If the groupmembers have different values, the encoder splits the group and sends a“1”, followed by refinement bits for each pixel of the group.

In one aspect, a method of processing an image, comprises dividing theimage into blocks using a first processor, setting a bit budget for eachblock, converting pixels of each block into binary representations,scanning and encoding the pixels from the most significant bit-plane tothe least significant bit-plane and generating a compressed image fileof the encoded pixels and saving the compressed image file to memorycoupled to the first processor. The image comprises an image having asparse histogram. Scanning and encoding the pixels at a currentbit-plane comprises processing all existing groups of the block, wherefor each group, if the pixels all have the same value in the currentbit-plane, writing a first bit of “0” into a bitstream and followed by asecond bit value designating the value of all the pixels in a currentgroup; if the pixel values do not all have the same value, writing thefirst bit value of “1” into the bitstream, followed by one bit for eachpixel in the current group designating the bit value of that pixel inthe current bit-plane, generating a new group and splitting the originalgroup, retaining pixels with a value “0” in the original group andplacing pixels with a value “1” in the new group. The method furthercomprises decoding the compressed image file with a second processor touncompress the image. Decoding the compressed image file comprisesprocessing each block from the MSB to the LSB, and processing allexisting groups for each bit-plane. Processing a group at the currentbit-plane comprising, reading a bit from the bitstream, if the bit has a“0” value, then reading a second bit from the bitstream and setting thevalue to be the bit value for all pixels in the group in a currentbit-plane, if the bit has a “1” value, then for each pixel in the group,one bit is read from the bitstream and set to be the bit value of thatpixel in the current bit-plane, a new group is generated and theoriginal group is split into two so that the pixels with the “0” valueare in the original group and the pixels with the “1” value are in thenew group. The bit budget of each of the blocks is shared between theblocks. The first processor is within a device selected from the groupconsisting of a personal computer, a laptop computer, a computerworkstation, a server, a mainframe computer, a handheld computer, apersonal digital assistant, a cellular/mobile telephone, a smartappliance, a gaming console, a digital camera, a digital camcorder, acamera phone, an iPod®/iPhone, a video player, a DVD writer/player, aBlu-ray® writer/player, a television and a home entertainment system.

In another aspect, an apparatus for processing an image, comprises afirst processor configured for processing pixels of an image andprogramming executable on the first processor for, dividing the imageinto blocks, setting a bit budget for each block, converting pixels ofeach block into binary representations, scanning and encoding the pixelsfrom the most significant bit-plane to the least significant bit-planeand generating a compressed image file of the encoded pixels. Theapparatus further comprises memory coupled to the first processor,wherein the compressed image file is stored within the memory.Programming is configured to scan and encode the pixels bit-plane bybit-plane, and for each bit-plane comprising processing all existinggroups of the block, where for each group, if the pixel all have thesame value in the current bit-plane, writing a first bit of “0” into abitstream and followed by a second bit value designating the value ofall the pixels in a current group; if the pixel values do not all havethe same value, writing the first bit value of “1” into the bitstream,followed by one bit for each pixel in the current group designating thebit value of that pixel in the current bit-plane, generating a new groupand splitting the original group, retaining pixels with a value “0” inthe original group and placing pixels with a value “1” in the new group.The apparatus further comprises: second programming executing on thefirst processor or a second processor and the second programmingconfigured to decode the compressed image file to uncompress the image.The decoder is further configured for processing each block from the MSBto the LSB, and processing all existing groups for each bit-plane.Processing a group at the current bit-plane comprising, reading a bitfrom the bitstream, if the bit has a “0” value, then reading a secondbit from the bitstream and setting the value to be the bit value for allpixels in the group in a current bit-plane, if the bit has a “1” value,then for each pixel in the group, one bit is read from the bitstream andset to be the bit value of that pixel in the current bit-plane, a newgroup is generated and the original group is split into two so that thepixels with the “0” value are in the original group and the pixels withthe “1” value are in the new group. The bit budget of each of the blocksis shared between the blocks. The apparatus is selected from the groupconsisting of a personal computer, a laptop computer, a computerworkstation, a server, a mainframe computer, a handheld computer, apersonal digital assistant, a cellular/mobile telephone, a smartappliance, a gaming console, a digital camera, a digital camcorder, acamera phone, an iPod®/iPhone, a video player, a DVD writer/player, aBlu-ray® writer/player, a television and a home entertainment system.

In yet another aspect, an apparatus for processing an image with asparse histogram, comprises first processing means configured forprocessing pixels of the image, encoding means executable on the firstprocessing means for dividing the image into blocks, setting a bitbudget for each block, converting pixels of each block into binaryrepresentations, scanning and encoding the pixels from the mostsignificant bit-plane to the least significant bit-plane and generatinga compressed image file of the encoded pixels and storage means coupledto the first processing means, wherein the compressed image file isstored within the storage means. Encoding means is configured to scanand encode the pixels bit-plane by bit-plane, and at the currentbit-plane it comprises processing all existing groups of the block,where for each group, if the pixel all have the same value in thecurrent bit-plane, writing a first bit of “0” into a bitstream andfollowed by a second bit value designating the value of all the pixelsin a current group; if the pixel values do not all have the same value,writing the first bit value of “1” into the bitstream, followed by onebit for each pixel in the current group designating the bit value ofthat pixel in the current bit-plane, generating a new group andsplitting the original group, retaining pixels with a value “0” in theoriginal group and placing pixels with a value “1” in the new group. Theapparatus further comprises decoding means executable on the firstprocessing means or a second processing means coupled to the firstprocessing means and the decoding means configured to decode thecompressed image file to uncompress the image. The decoding meanscomprises a decoder configured to decode the compressed image file byprocessing each block from the MSB to the LSB, and processing allexisting groups for each bit-plane. Processing a group at the currentbit-plane comprising, reading a bit from the bitstream, if the bit has a“0” value, then reading a second bit from the bitstream and setting thevalue to be the bit value for all pixels in the group in a currentbit-plane, if the bit has a “1” value, then for each pixel in the group,one bit is read from the bitstream and set to be the bit value of thatpixel in the current bit-plane, a new group is generated and theoriginal group is split into two so that the pixels with the “0” valueare in the original group and the pixels with the “1” value are in thenew group. The bit budget of each of the blocks is shared between theblocks. The apparatus is selected from the group consisting of apersonal computer, a laptop computer, a computer workstation, a server,a mainframe computer, a handheld computer, a personal digital assistant,a cellular/mobile telephone, a smart appliance, a gaming console, adigital camera, a digital camcorder, a camera phone, an iPod®/iPhone, avideo player, a DVD writer/player, a Blu-ray® writer/player, atelevision and a home entertainment system.

In another aspect, an apparatus for processing an image with a sparsehistogram, comprises a first processor for processing pixels of theimage, an encoder executable on the first processor for dividing theimage into blocks, setting a bit budget for each block, convertingpixels of each block into binary representations, scanning and encodingthe pixels from the most significant bit-plane to the least significantbit-plane and generating a compressed image file of the encoded pixelsand a storage device coupled to the first processing device, wherein thecompressed image file is stored within the storage device. The encoderis configured to scan and encode bit-plane by bit-plane, and at thecurrent bit-plane the encoding comprises processing all existing groupsof the block, where for each group, if the pixel all have the same valuein the current bit-plane, writing a first bit of “0” into a bitstreamand followed by a second bit value designating the value of all thepixels in a current group; if the pixel values do not all have the samevalue, writing the first bit value of “1” into the bitstream, followedby one bit for each pixel in the current group designating the bit valueof that pixel in the current bit-plane, generating a new group andsplitting the original group, retaining pixels with a value “0” in theoriginal group and placing pixels with a value “1” in the new group. Theapparatus further comprises a decoder executable on the first processingmeans or a second processing means coupled to the first processing meansand the decoder configured to decode the compressed image file touncompress the image. The decoder is configured to decode the compressedimage file by processing each block from the MSB to the LSB, andprocessing all existing groups for each bit-plane. Processing a group atthe current bit-plane comprising, reading a bit from the bitstream, ifthe bit has a “0” value, then reading a second bit from the bitstreamand setting the value to be the bit value for all pixels in the group ina current bit-plane, if the bit has a “1” value, then for each pixel inthe group, one bit is read from the bitstream and set to be the bitvalue of that pixel in the current bit-plane, a new group is generatedand the original group is split into two so that the pixels with the “0”value are in the original group and the pixels with the “1” value are inthe new group. The bit budget of each of the blocks is shared betweenthe blocks. The apparatus is selected from the group consisting of apersonal computer, a laptop computer, a computer workstation, a server,a mainframe computer, a handheld computer, a personal digital assistant,a cellular/mobile telephone, a smart appliance, a gaming console, adigital camera, a digital camcorder, a camera phone, an iPod®/iPhone, avideo player, a DVD writer/player, a Blu-ray® writer/player, atelevision and a home entertainment system.

In another aspect, a network of devices comprises an encoder device forencoding an image comprises dividing the image into blocks, setting abit budget for each block, converting pixels of each block into binaryrepresentations, scanning and encoding the pixels from the mostsignificant bit-plane to the least significant bit-plane and generatinga compressed image file of the encoded pixels and a decoder device fordecoding the compressed image file comprises by processing each blockfrom the MSB to the LSB, and processing all existing groups for eachbit-plane. Processing a group at the current bit-plane comprising,reading a bit from the bitstream, if the bit has a “0” value, thenreading a second bit from the bitstream and setting the value to be thebit value for all pixels in the group in a current bit-plane, if the bithas a “1” value, then for each pixel in the group, one bit is read fromthe bitstream and set to be the bit value of that pixel in the currentbit-plane, a new group is generated and the original group is split intotwo so that the pixels with the “0” value are in the original group andthe pixels with the “1” value are in the new group. The encoder deviceis configured to scan and encode the pixels bit-plane by bit-plane, andat the current bit-plane the encoding comprises processing all existinggroups of the block, where for each group, if the pixel all have thesame value in the current bit-plane, writing a first bit of “0” into abitstream and followed by a second bit value designating the value ofall the pixels in a current group; if the pixel values do not all havethe same value, writing the first bit value of “1” into the bitstream,followed by one bit for each pixel in the current group designating thebit value of that pixel in the current bit-plane, generating a new groupand splitting the original group, retaining pixels with a value “0” inthe original group and placing pixels with a value “1” in the new group.The bit budget of each of the blocks is shared between the blocks.

In some embodiments, multiple blocks are able to share their bit budgetwith each other, such that more bits are able to be allocated to blocksthat are difficult to encode. This is to improve overall codingperformance. In one extreme case, one bit budget is shared by all blocksin an image. In another extreme case, each block has its own bit budget.Any variation of bit budgets between one bit budget for all blocks andeach block having a bit budget is possible.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a schematic diagram of prior art discrete cosinetransform of an image and corresponding histogram.

FIG. 2 illustrates a typical graphics image.

FIG. 3 illustrates a schematic diagram of method for encoding a graphicsimage in accordance with some embodiments.

FIG. 4 illustrates a schematic diagram of EGC encoding for a bit-planein a block according to some embodiments.

FIG. 5 illustrates a schematic diagram of EGC encoding for a blockaccording to some embodiments.

FIG. 6 illustrates a schematic diagram of EGC encoding of multipleblocks that share the bit budget according to some embodiments.

FIG. 7 illustrates a schematic diagram of EGC decoding for a bit-planein a block according to some embodiments.

FIG. 8 illustrates a schematic diagram of EGC decoding for a singleblock according to some embodiments.

FIG. 9 illustrates a schematic diagram of EGC decoding of multipleblocks that share the bit budget according to some embodiments.

FIG. 10 illustrates a schematic diagram of a system for encoding anddecoding a graphics image using EGC in accordance with some embodiments.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

Referring more specifically to the drawings, for illustrative purposesthe embedded graphics coding for images with sparse histograms isembodied in the apparatus generally shown in the non-prior art figures.It will be appreciated that the apparatus is able to vary as toconfiguration and as to details of the parts, and that the method isable to vary as to the specific steps and sequence, without departingfrom the basic concepts as disclosed herein.

The embedded graphics coding for images with sparse histograms includesa coding algorithm and systems and methods to encode images havingsparse histograms, e.g. typically for (but not limited to) graphical ortextual images.

The algorithm, systems and methods use a new process called EmbeddedGraphics Coding (EGC), which provides lossy to lossless scalability,wherein even if the decoding is stopped in the middle of the bitstream,the decoder is able to still make a reasonable decoded block based onthe bits it has received. If the entire bitstream is sent, the image isable to be losslessly reconstructed.

The algorithm, systems and methods described herein have low complexity,and high coding performance.

FIG. 3 illustrates a flow diagram of the process 30 of encoding an imagewith a sparse histogram. First the image is divided into blocks at step32. Next, a bit budget is set for each block at step 34. The bit budgetis generally agreed upon by both the encoder and the decoder. Theencoder and decoder are able to be configured such that the bit budgetis able to be dynamically changed if the bandwidth is time-varying. Thecoded bitstream is fully embedded, so the bit budget is able to bechanged arbitrarily.

For each block, the pixels of the image are converted into binaryrepresentations at step 36. It is to be noted that the encoder need notperform any prediction or transform, because it is assumed the pixelsalready have a sparse histogram. The lack of prediction or transformcuts back on computations and required processing power.

Next, at step 38, the pixels for each block are scanned and encodedbit-plane by bit-plane. A bit-plane of a digital image is a set of bitshaving the same position in the respective binary numbers. For example,for 8-bit data representation there are 8 bit-planes. The firstbit-plane contains the set of the most significant bit and the 8thcontains the least significant bit. The most significant bit-plane (MSB)is scanned and encoded first, progressing to the next-most significantbit-plane, until the least significant bit-plane (LSB) is scanned. Theencoding process of each bit-plane is described in detail below.

At step 40, the encoding is stopped. Encoding is generally stopped ifone of two conditions occurs: 1) the bit budget of the current block isdepleted, or 2) if the reconstructed block has reached the end of LSB.In this case, the decoder has also determined the end of a block.

FIG. 4 illustrates a schematic diagram of EGC encoding for a bit-planein a block according to some embodiments. In the step 50, the number ofexisting groups (N) is obtained. In the step 52, the current group isset to be group 1. In the step 54, the algorithm evaluates whether thepixels in the current group have the same bit value in the currentbit-plane.

If all the pixels in the group have the same bit value, a “0” is writteninto the bitstream followed by another “0” or “1” to indicate the bitvalue for all pixels in the current group, in the step 56.

If the pixels in the group do not have the same bit value, a “1” iswritten into the bitstream, followed by the bit value for each pixel inthe current group, in the step 58. In the step 60, a new group isgenerated without increasing N. In the step 62, the group is split intotwo where the pixels with value “0” are kept in the same group andpixels with the value “1” are put into the new group.

In the step 64, the encoder evaluates whether the current group is groupN. If the current group is not group N, then the process goes to thenext group, in the step 66, and the process resumes in the step 54. Ifthe current group is group N, then encoding the current bit-plane ends.

FIG. 5 illustrates a schematic diagram of EGC encoding for a blockaccording to some embodiments. In the step 68, all of the pixels of theblock are placed in group 1. In the step 70, the current bit-plane isset to be the MSB. In the step 72, the current bit-plane is encodedusing the method described in FIG. 4. In the step 74, it is determinedif the current bit-plane is the LSB. If the current bit-plane is not theLSB, then the process moves to the next bit-plane, in the step 76, andthe process resumes in the step 72. If the current bit-plane is the LSB,then encoding the current block stops.

FIG. 6 illustrates a schematic diagram of EGC encoding of multipleblocks that share the bit budget according to some embodiments. In thestep 78, the pixels of each block are put into a same group for eachblock (pixels of different blocks are in different groups). In the step80, the current bit-plane is set to be the MSB. In the step 82, thecurrent block is set to be the first block. In the step 84, the currentbit-plane of the current block is encoded using the method of FIG. 4. Inthe step 86, it is determined if the current block is the last block. Ifthe current block is not the last block, then the process moves to thenext block in the step 88, and the process resumes at the step 84. Ifthe current block is the last block, then it is determined if thecurrent bit-plane is the LSB, in the step 90. If the current bit-planeis the LSB, then the encoding ends. If the current bit-plane is not theLSB, then the process moves to the next bit-plane in the step 92, andthe process resumes at the step 82.

FIG. 7 illustrates a schematic diagram of EGC decoding for a bit-planein a block according to some embodiments. In the step 100, the number ofexisting groups (N) is obtained. In the step 102, the current group isset to be group 1. In the step 104, a bit is read from the bitstream. Inthe step 106, it is determined if the bit contains a value of “0.” Ifthe value is “0,” then another bit is read from the bitstream and thatbit value is set for all pixels in the group in the current bit-plane,in the step 108. For example, if the second bit read is a “1,” then allbits are set as a “1.” If the bit value is not “0,” then a bit is readfrom the bitstream for each pixel in the group, and the bit is set to bethe bit value of that pixel in the current bit-plane, in the step 110.

In the step 112, a new group is generated without increasing N. In thestep 114, the group is split, where the pixels with value “0” are keptin the same group, and the pixels with value “1” are put into the newgroup. In the step 116, it is determined if the current group is groupN. If the current group is not group N, then the process moves to thenext group in the step 118. If the current group is group N, then thecurrent bit-plane decoding ends.

FIG. 8 illustrates a schematic diagram of EGC decoding for a singleblock according to some embodiments. In the step 120, all of the pixelsof the block are placed in group 1. In the step 122, the currentbit-plane is set to be the MSB. In the step 124, the current bit-planeis decoded using the method described in FIG. 7. In the step 126, it isdetermined if the current bit-plane is the LSB. If the current bit-planeis not the LSB, then the process moves to the next bit-plane, in thestep 128, and the process resumes in the step 124. If the currentbit-plane is the LSB, then decoding the current block stops.

FIG. 9 illustrates a schematic diagram of EGC decoding of multipleblocks that share the bit budget according to some embodiments. In thestep 130, the pixels of each block are put into a same group for eachblock (pixels of different blocks are in different groups). In the step132, the current bit-plane is set to be the MSB. In the step 134, thecurrent block is set to be the first block. In the step 136, the currentbit-plane of the current block is decoded using the method of FIG. 7. Inthe step 138, it is determined if the current block is the last block.If the current block is not the last block, then the process moves tothe next block in the step 140, and the process resumes at the step 136.If the current block is the last block, then it is determined if thecurrent bit-plane is the LSB, in the step 142. If the current bit-planeis the LSB, then the encoding ends. If the current bit-plane is not theLSB, then the process moves to the next bit-plane in the step 144, andthe process resumes at the step 134.

In some embodiments, multiple blocks are able to share their bit budgetwith each other, such that more bits are able to be allocated to blocksthat are difficult to encode. This is to improve overall codingperformance. In one extreme case, one bit budget is shared by all blocksin an image. In another extreme case, each block has its own bit budget.Any variation of bit budgets between one bit budget for all blocks andeach block having a bit budget is possible.

In some cases, the algorithm performs pixel reconstruction of apartially recovered image. If a pixel has had its LSB decoded, thedecoder knows the true value of the pixel. If the decoding of a pixelstops somewhere in the middle, then the decoder only knows a range ofvalues in which the pixel value is in.

For example, if the first 5 bit-planes of a pixel is decoded as 10110,and there are still 3 bit-planes remaining unknown to the decoder, thenthe true pixel value is in the range 10110000˜10110111 (in binaryrepresentation). In this case, the decoder chooses the close tomid-point reconstruction and sets the unknown bits to be 100 . . . 0. Inthe example above, the reconstruction value would be 10110100.

FIG. 10 illustrates an exemplary system 200 for encoding and decoding agraphics image with a sparse histogram in accordance with someembodiments. The raw image 202 is processed by the first device 204having a processor 206 and encoder 208 in accordance with someembodiments. The devices 204, 214 are able to be a personal computer, alaptop computer, a computer workstation, a server, a mainframe computer,a handheld computer, a personal digital assistant, a cellular/mobiletelephone, a smart appliance, a gaming console, a digital camera, adigital camcorder, a camera phone, an iPod®/iPhone, a video player, aDVD writer/player, a Blu-ray®writer/player, a television, a homeentertainment system or other device with a processor 206 and memory orother storage means 209 for storing encoding module 208. The raw imageis able to then be encoded using encoder 208 comprisingprogramming/encoding means to form a compressed image file 210 (e.g. viathe algorithms/processes described above). This is able to be sent overthe internet 212 or like network to a second device 214. Second device214 comprises a processor 216, memory or storage means 219 and decodingmodule 218 that comprises programming/decoding means configured to readthe compressed data file 210 and decodes it in accordance with themethods described herein (e.g. via the algorithms/processes describedabove) to generate the uncompressed image 220. It is appreciated thatboth devices are able to include both the encoding module 208 anddecoding module 218, and likewise perform both encoding and decodingoperations.

Example 1

In an exemplary 8-bit image, half of the pixels are zeros, and the otherpixels have the value of 255. The locations of 0s and 255s are random.Theoretically, at least 1 bit per pixel is needed for losslesscompression. Conventional image coding algorithms cannot providelossless compression close to 1 bit per pixel (except for histogrampacking)

In the embedded graphics coding algorithm (e.g. encoding algorithm 38),a “1” is sent in the MSB to indicate an original group that was splitinto two groups, and 1 bit per pixel to send the bit values of eachpixel at the MSB. Otherwise, a “0” is sent to indicate that all thepixels in the group are the same.

For the following bit-planes, a “00” is sent for the group of 0s, and“01” is sent for the group of 255s.

The total bits for lossless compression of a block is

1+n+4×7=n+29

where n is the pixel number of a block.

The average bit rate is (1+29/n) bit per pixel, which is close to thetheoretical limit for reasonable block sizes (e.g., when n=8×8=64).

The encoding algorithm is able to also be constructed so that if a grouphas only 1 or 2 members, it does not send the 1-bit “split-or-not”signal, and the refinement bit(s) are sent directly.

Also, the order of the bit-stream is able to be re-arranged for betterembeddedness. If a group is split, the sending of its refinement bits isdelayed, and the algorithm moves forward to process the next group. Itis possible that the next group is not split, and thus one bit is ableto be used to represent multiple bits. Also, if the bit-stream isstopped in the middle of a bit-plane, this approach provides betterreconstruction quality.

There could be some visual artifacts if the refining of a group isstopped in the middle of the group. To avoid this problem, the decoderis able to be configured to withdraw refining of a group if some of therefinement bits for the current group are not received.

In another alternative embodiment, instead of sending the “split-or-not”bit and the refinement bits as raw bits, the bits are able to also becoded using run-length coding or binary arithmetic coding to furtherimprove coding efficiency.

The embedded graphics coding methods are also suitable as a supplementto conventional image coding. The embedded graphics coding is able to becombined with any block-based image coding algorithms. In such case, 1bit in the bit-stream is used to tell the decoder whether EGC is used.

Embodiments are described with reference to flowchart illustrations ofmethods and systems according to some embodiments. These methods andsystems are also able to be implemented as computer program products. Inthis regard, each block or step of a flowchart, and combinations ofblocks (and/or steps) in a flowchart, are able to be implemented byvarious means, such as hardware, firmware, and/or software including oneor more computer program instructions embodied in computer-readableprogram code logic. As will be appreciated, any such computer programinstructions are able to be loaded onto a computer, including withoutlimitation a general purpose computer or special purpose computer, orother programmable processing apparatus to produce a machine, such thatthe computer program instructions which execute on the computer or otherprogrammable processing apparatus create means for implementing thefunctions specified in the block(s) of the flowchart(s).

Accordingly, blocks of the flowcharts support combinations of means forperforming the specified functions, combinations of steps for performingthe specified functions, and computer program instructions, such asembodied in computer-readable program code logic means, for performingthe specified functions. It will also be understood that each block ofthe flowchart illustrations, and combinations of blocks in the flowchartillustrations, are able to be implemented by special purposehardware-based computer systems which perform the specified functions orsteps, or combinations of special purpose hardware and computer-readableprogram code logic means.

Furthermore, these computer program instructions, such as embodied incomputer-readable program code logic, are able to also be stored in acomputer-readable memory that is able to direct a computer or otherprogrammable processing apparatus to function in a particular manner,such that the instructions stored in the computer-readable memoryproduce an article of manufacture including instruction means whichimplement the function specified in the block(s) of the flowchart(s).The computer program instructions are able to also be loaded onto acomputer or other programmable processing apparatus to cause a series ofoperational steps to be performed on the computer or other programmableprocessing apparatus to produce a computer-implemented process such thatthe instructions which execute on the computer or other programmableprocessing apparatus provide steps for implementing the functionsspecified in the block(s) of the flowchart(s).

To utilize EGC for images with sparse histograms, a user acquires avideo/image such as on a digital camcorder, and while or after the videois acquired, or when sending the video to another device such as acomputer, the EGC method automatically encodes each image of the video,so that the video is encoded appropriately to maintain a high qualityvideo. The EGC method occurs automatically without user involvement. Thevideo is also able to be decoded to be displayed using a similar method.

In operation, the EGC method is used to encode and transmit images suchas frames of a video. Each image block is processed from the MSB to theLSB, hence the resulting bit-plane is still embedded. The improvedencoding method is able to be used in any implementation including, butnot limited to, wireless high definition (WiHD).

The EGC for images with sparse histograms method described herein isable to be used with videos and/or images, including high definitionvideos.

High definition video is able to be in any format including but notlimited to HDCAM, HDCAM-SR, DVCPRO HD, D5 HD, XDCAM HD, HDV and AVCHD.

SOME EMBODIMENTS OF EMBEDDED GRAPHICS CODING FOR IMAGES WITH SPARSEHISTOGRAMS

-   1. A method of processing an image, comprising:    -   a. dividing the image into blocks using a first processor;    -   b. setting a bit budget for each block;    -   c. converting pixels of each block into binary representations;    -   d. scanning and encoding the pixels from the most significant        bit-plane to the least significant bit-plane; and    -   e. generating a compressed image file of the encoded pixels and        saving the compressed image file to memory coupled to the first        processor.-   2. The method as recited in clause 1, wherein the image comprises an    image having a sparse histogram.-   3. The method as recited in clause 1, wherein scanning and encoding    the pixels at each bit-plane comprises processing each existing    group in the bit-plane, which further comprises:    -   a. if the pixel values of the group all have the same value at        the current bit-plane, writing a first bit value of “0” into a        bitstream; and    -   b. writing a second bit value into the bitstream designating the        value of all the pixels in a current group.-   4. The method as recited in clause 3, further comprising:    -   a. if the pixel values of the group do not all have the same        value at the current bit-plane, writing the first bit value of        “1” into the bitstream, followed by one bit for each pixel in        the current group designating the bit value of that pixel in the        current bit-plane;    -   b. generating a new group; and    -   c. splitting the original group into two, retaining pixels with        a value “0” in the original group and placing pixels with a        value “1” in the new group.-   5. The method as recited in clause 4, further comprising decoding    the compressed image file with a second processor to uncompress the    image.-   6. The method as recited in clause 5, wherein decoding the    compressed image file comprises scanning and decoding the pixels    from the most significant bit-plane to the least significant    bit-plane, and for each bit-plane:    -   a. obtaining the number of existing groups;    -   b. setting the current group to be a first group;    -   c. reading a bit from the bitstream;    -   d. if the bit has a “0” value, then reading a second bit from        the bitstream and setting the value to be the bit value for all        pixels in the group in a current bit-plane;    -   e. if the bit has a “1” value, then for each pixel in the group,        one bit is read from the bitstream and set to be the bit value        of that pixel in the current bit-plane, a new group is generated        and the new group is split into the first group and the second        group so that the pixels with the “0” value are in the first        group and the pixels with the “1” value are in the second group;        and    -   f. repeating c-e until the end of the current bit-plane is        reached.-   7. The method as recited in clause 1, wherein the bit budget of each    of the blocks is shared between the blocks.-   8. The method as recited in clause 1, wherein the first processor is    within a device selected from the group consisting of a personal    computer, a laptop computer, a computer workstation, a server, a    mainframe computer, a handheld computer, a personal digital    assistant, a cellular/mobile telephone, a smart appliance, a gaming    console, a digital camera, a digital camcorder, a camera phone, an    iPod®/iPhone, a video player, a DVD writer/player, a Blu-ray®    writer/player, a television and a home entertainment system.-   9. An apparatus for processing an image, comprising:    -   a. a first processor configured for processing pixels of an        image; and    -   b. programming executable on the first processor for,        -   i. dividing the image into blocks;        -   ii. setting a bit budget for each block;        -   iii. converting pixels of each block into binary            representations;        -   iv. scanning and encoding the pixels from the most            significant bit-plane to the least significant bit-plane;            and        -   v. generating a compressed image file of the encoded pixels.-   10. The apparatus as recited in clause 9, further comprising memory    coupled to the first processor, wherein the compressed image file is    stored within the memory.-   11. The apparatus as recited in clause 9, wherein programming is    configured to scan and encode the pixels at each bit-plane comprises    processing each existing group in the bit-plane, which further    comprises:    -   a. if the pixel values of the group all have the same value at        the current bit-plane, writing a first bit value of “0” into a        bitstream; and    -   b. writing a second bit value into the bitstream designating the        value of all the pixels in a current group.-   12. The apparatus as recited in clause 11, wherein the programming    is further configured to scan and encode the pixels by:    -   a. if the pixel values of the group do not all have the same        value at the current bit-plane, writing the first bit value of        “1” into the bitstream, followed by one bit for each pixel in        the current group designating the bit value of that pixel in the        current bit-plane;    -   b. generating a new group; and    -   c. splitting the original group into two, retaining pixels with        a value “0” in the original group and placing pixels with a        value “1” in the new group.-   13. The apparatus as recited in clause 12, further comprising:    -   a. second programming executing on the first processor or a        second processor; and    -   b. the second programming configured to decode the compressed        image file to uncompress the image.-   14. The apparatus as recited in clause 13, wherein the decoder is    further configured for scanning and decoding the pixels from the    most significant bit-plane to the least significant bit-plane, and    for each bit-plane:    -   a. obtaining the number of existing groups;    -   b. setting the current group to be a first group;    -   c. reading a bit from the bitstream;    -   d. if the bit has a “0” value, then reading a second bit from        the bitstream and setting the value to be the bit value for all        pixels in the group in a current bit-plane;    -   e. if the bit has a “1” value, then for each pixel in the group,        one bit is read from the bitstream and set to be the bit value        of that pixel in the current bit-plane, a new group is generated        and the new group is split into the first group and the second        group so that the pixels with the “0” value are in the first        group and the pixels with the “1” value are in the second group;        and    -   f. repeating c-e until the end of the current bit-plane is        reached.-   15. The apparatus as recited in clause 9, wherein the bit budget of    each of the blocks is shared between the blocks.-   16. The apparatus as recited in clause 9, wherein the apparatus is    selected from the group consisting of a personal computer, a laptop    computer, a computer workstation, a server, a mainframe computer, a    handheld computer, a personal digital assistant, a cellular/mobile    telephone, a smart appliance, a gaming console, a digital camera, a    digital camcorder, a camera phone, an iPod®/iPhone, a video player,    a DVD writer/player, a Blu-ray® writer/player, a television and a    home entertainment system.-   17. An apparatus for processing an image with a sparse histogram,    comprising:    -   a. first processing means configured for processing pixels of        the image;    -   b. encoding means executable on the first processing means for:        -   i. dividing the image into blocks;        -   ii. setting a bit budget for each block;        -   iii. converting pixels of each block into binary            representations;        -   iv. scanning and encoding the pixels from the most            significant bit-plane to the least significant bit-plane;            and        -   v. generating a compressed image file of the encoded pixels;            and    -   c. storage means coupled to the first processing means, wherein        the compressed image file is stored within the storage means.-   18. The apparatus as recited in clause 17, wherein encoding means is    configured to scan and encode the pixels at each bit-plane comprises    processing each existing group in the bit-plane, which further    comprises:    -   a. if the pixel values of the group all have the same value at        the current bit-plane, writing a first bit value of “0” into a        bitstream; and    -   b. writing a second bit value into the bitstream designating the        value of all the pixels in a current group.-   19. The apparatus as recited in clause 18, wherein encoding means is    configured to scan and encode the pixels comprising:    -   a. if the pixel values of the group do not all have the same        value at the current bit-plane, writing the first bit value of        “1” into the bitstream, followed by one bit for each pixel in        the current group designating the bit value of that pixel in the        current bit-plane;    -   b. generating a new group; and    -   c. splitting the original group into two, retaining pixels with        a value “0” in the original group and placing pixels with a        value “1” in the new group.-   20. The apparatus as recited in clause 19, further comprising:    -   a. decoding means executable on the first processing means or a        second processing means coupled to the first processing means;        and    -   b. the decoding means configured to decode the compressed image        file to uncompress the image.-   21. The apparatus as recited in clause 20: wherein the decoding    means comprises a decoder configured to decode the compressed image    file by scanning and decoding the pixels from the most significant    bit-plane to the least significant bit-plane, and for each    bit-plane:    -   a. obtaining the number of existing groups;    -   b. setting the current group to be a first group;    -   c. reading a bit from the bitstream;    -   d. if the bit has a “0” value, then reading a second bit from        the bitstream and setting the value to be the bit value for all        pixels in the group in a current bit-plane;    -   e. if the bit has a “1” value, then for each pixel in the group,        one bit is read from the bitstream and set to be the bit value        of that pixel in the current bit-plane, a new group is generated        and the new group is split into the first group and the second        group so that the pixels with the “0” value are in the first        group and the pixels with the “1” value are in the second group;        and    -   f. repeating c-e until the end of the current bit-plane is        reached.-   22. The apparatus as recited in clause 17, wherein the bit budget of    each of the blocks is shared between the blocks.-   23. The apparatus as recited in clause 17, wherein the apparatus is    selected from the group consisting of a personal computer, a laptop    computer, a computer workstation, a server, a mainframe computer, a    handheld computer, a personal digital assistant, a cellular/mobile    telephone, a smart appliance, a gaming console, a digital camera, a    digital camcorder, a camera phone, an iPod®/iPhone, a video player,    a DVD writer/player, a Blu-ray® writer/player, a television and a    home entertainment system.-   24. An apparatus for processing an image with a sparse histogram,    comprising:    -   a. a first processor for processing pixels of the image;    -   b. an encoder executable on the first processor for:        -   i. dividing the image into blocks;        -   ii. setting a bit budget for each block;        -   iii. converting pixels of each block into binary            representations;        -   iv. scanning and encoding the pixels from the most            significant bit-plane to the least significant bit-plane;            and        -   v. generating a compressed image file of the encoded pixels;            and    -   c. a storage device coupled to the first processing device,        wherein the compressed image file is stored within the storage        device.-   25. The apparatus as recited in clause 24, wherein the encoder is    configured to scan and encode the pixels comprising:    -   a. writing a first bit value into a bitstream designating that        the pixel values all have the same value, if the pixel values        all have the same value; and    -   b. writing a second bit value into the bitstream designating the        value of all the pixels in a current group.-   26. The apparatus as recited in clause 25, wherein the encoder is    configured to scan and encode the pixels at each bit-plane    comprising processing each existing group in the bit-plane, which    further comprises:    -   a. if the pixel values of the group all have the same value at        the current bit-plane, writing a first bit value of “0” into a        bitstream;    -   b. writing a second bit value into the bitstream designating the        value of all the pixels in a current group;    -   c. if the pixel values of the group do not all have the same        value at the current bit-plane, writing the first bit value of        “1” into the bitstream, followed by one bit for each pixel in        the current group designating the bit value of that pixel in the        current bit-plane;    -   d. generating a new group; and    -   e. splitting the original group into two, retaining pixels with        a value “0” in the original group and placing pixels with a        value “1” in the new group.-   27. The apparatus as recited in clause 26, further comprising:    -   a. a decoder executable on the first processing means or a        second processing means coupled to the first processing means;        and    -   b. the decoder configured to decode the compressed image file to        uncompress the image.-   28. The apparatus as recited in clause 27 wherein the decoder is    configured to decode the compressed image file by scanning and    decoding the pixels from the most significant bit-plane to the least    significant bit-plane, and for each bit-plane:    -   a. obtaining the number of existing groups;    -   b. setting the current group to be a first group;    -   c. reading a bit from the bitstream;    -   d. if the bit has a “0” value, then reading a second bit from        the bitstream and setting the value to be the bit value for all        pixels in the group in a current bit-plane;    -   e. if the bit has a “1” value, then for each pixel in the group,        one bit is read from the bitstream and set to be the bit value        of that pixel in the current bit-plane, a new group is generated        and the new group is split into the first group and the second        group so that the pixels with the “0” value are in the first        group and the pixels with the “1” value are in the second group;        and    -   f. repeating c-e until the end of the current bit-plane is        reached.-   29. The apparatus as recited in clause 24, wherein the bit budget of    each of the blocks is shared between the blocks.-   30. The apparatus as recited in clause 24, wherein the apparatus is    selected from the group consisting of a personal computer, a laptop    computer, a computer workstation, a server, a mainframe computer, a    handheld computer, a personal digital assistant, a cellular/mobile    telephone, a smart appliance, a gaming console, a digital camera, a    digital camcorder, a camera phone, an iPod®/iPhone, a video player,    a DVD writer/player, a Blu-ray® writer/player, a television and a    home entertainment system.-   31. A network of devices comprising:    -   a. an encoder device for encoding an image comprising:        -   i. dividing the image into blocks;        -   ii. setting a bit budget for each block;        -   iii. converting pixels of each block into binary            representations;        -   iv. scanning and encoding the pixels from the most            significant bit-plane to the least significant bit-plane;            and        -   v. generating a compressed image file of the encoded pixels;            and    -   b. a decoder device for decoding the compressed image file        comprising scanning and decoding the pixels from the most        significant bit-plane to the least significant bit-plane, and        for each bit-plane:        -   i. obtaining a number of existing groups;        -   ii. setting a current group to be a first group;        -   iii. reading a bit from a bitstream;        -   iv. if the bit has a “0” value, then reading a second bit            from the bitstream and setting the value to be the bit value            for all pixels in the group in a current bit-plane;        -   v. if the bit has a “1” value, then for each pixel in the            group, one bit is read from the bitstream and set to be the            bit value of that pixel in the current bit-plane, a new            group is generated and the new group is split into the first            group and the second group so that the pixels with the “0”            value are in the first group and the pixels with the “1”            value are in the second group; and        -   vi. repeating iii-v until the end of the current bit-plane            is reached.-   32. The apparatus as recited in clause 31, wherein the encoder    device is configured to scan and encode the pixels at each bit-plane    comprising processing each existing group in the bit-plane, which    further comprises:    -   a. if the pixel values of the group all have the same value at        the current bit-plane, writing a first bit value of “0” into a        bitstream;    -   b. writing a second bit value into the bitstream designating the        value of all the pixels in a current group.-   33. The apparatus as recited in clause 32, wherein the encoder    device is configured to scan and encode the pixels comprising:    -   a. if the pixel values of the group do not all have the same        value at the current bit-plane, writing the first bit value of        “1” into the bitstream, followed by one bit for each pixel in        the current group designating the bit value of that pixel in the        current bit-plane;    -   b. generating a new group; and    -   c. splitting the original group into two, retaining pixels with        a value “0” in the original group and placing pixels with a        value “1” in the new group.-   34. The apparatus as recited in clause 33, wherein the bit budget of    each of the blocks is shared between the blocks.

The present invention has been described in terms of specificembodiments incorporating details to facilitate the understanding ofprinciples of construction and operation of the invention.

Such reference herein to specific embodiments and details thereof is notintended to limit the scope of the claims appended hereto. It will bereadily apparent to one skilled in the art that other variousmodifications may be made in the embodiment chosen for illustrationwithout departing from the spirit and scope of the invention as definedby the claims.

What is claimed is:
 1. A method of processing an image, comprising: a.dividing the image into blocks using a first processor; b. setting a bitbudget for each block; c. converting pixels of each block into binaryrepresentations; d. scanning and encoding the pixels from the mostsignificant bit-plane to the least significant bit-plane; and e.generating a compressed image file of the encoded pixels and saving thecompressed image file to memory coupled to the first processor.
 2. Themethod as recited in claim 1, wherein the image comprises an imagehaving a sparse histogram.
 3. The method as recited in claim 1, whereinscanning and encoding the pixels at each bit-plane comprises processingeach existing group in the bit-plane, which further comprises: a. if thepixel values of the group all have the same value at the currentbit-plane, writing a first bit value of “0” into a bitstream; and b.writing a second bit value into the bitstream designating the value ofall the pixels in a current group.
 4. The method as recited in claim 3,further comprising: a. if the pixel values of the group do not all havethe same value at the current bit-plane, writing the first bit value of“1” into the bitstream, followed by one bit for each pixel in thecurrent group designating the bit value of that pixel in the currentbit-plane; b. generating a new group; and c. splitting the originalgroup into two, retaining pixels with a value “0” in the original groupand placing pixels with a value “1” in the new group.
 5. The method asrecited in claim 4, further comprising decoding the compressed imagefile with a second processor to uncompress the image.
 6. The method asrecited in claim 5, wherein decoding the compressed image file comprisesscanning and decoding the pixels from the most significant bit-plane tothe least significant bit-plane, and for each bit-plane: a. obtainingthe number of existing groups; b. setting the current group to be afirst group; c. reading a bit from the bitstream; d. if the bit has a“0” value, then reading a second bit from the bitstream and setting thevalue to be the bit value for all pixels in the group in a currentbit-plane; e. if the bit has a “1” value, then for each pixel in thegroup, one bit is read from the bitstream and set to be the bit value ofthat pixel in the current bit-plane, a new group is generated and thenew group is split into the first group and the second group so that thepixels with the “0” value are in the first group and the pixels with the“1” value are in the second group; and f. repeating c-e until the end ofthe current bit-plane is reached.
 7. The method as recited in claim 1,wherein the bit budget of each of the blocks is shared between theblocks.
 8. The method as recited in claim 1, wherein the first processoris within a device selected from the group consisting of a personalcomputer, a laptop computer, a computer workstation, a server, amainframe computer, a handheld computer, a personal digital assistant, acellular/mobile telephone, a smart appliance, a gaming console, adigital camera, a digital camcorder, a camera phone, an iPod®/iPhone, avideo player, a DVD writer/player, a Blu-ray® writer/player, atelevision and a home entertainment system.
 9. An apparatus forprocessing an image, comprising: a. a first processor configured forprocessing pixels of an image; and b. programming executable on thefirst processor for, i. dividing the image into blocks; ii. setting abit budget for each block; iii. converting pixels of each block intobinary representations; iv. scanning and encoding the pixels from themost significant bit-plane to the least significant bit-plane; and v.generating a compressed image file of the encoded pixels.
 10. Theapparatus as recited in claim 9, further comprising memory coupled tothe first processor, wherein the compressed image file is stored withinthe memory.
 11. The apparatus as recited in claim 9, wherein programmingis configured to scan and encode the pixels at each bit-plane comprisesprocessing each existing group in the bit-plane, which furthercomprises: a. if the pixel values of the group all have the same valueat the current bit-plane, writing a first bit value of “0” into abitstream; and b. writing a second bit value into the bitstreamdesignating the value of all the pixels in a current group.
 12. Theapparatus as recited in claim 11, wherein the programming is furtherconfigured to scan and encode the pixels by: a. if the pixel values ofthe group do not all have the same value at the current bit-plane,writing the first bit value of “1” into the bitstream, followed by onebit for each pixel in the current group designating the bit value ofthat pixel in the current bit-plane; b. generating a new group; and c.splitting the original group into two, retaining pixels with a value “0”in the original group and placing pixels with a value “1” in the newgroup.
 13. The apparatus as recited in claim 12, further comprising: a.second programming executing on the first processor or a secondprocessor; and b. the second programming configured to decode thecompressed image file to uncompress the image.
 14. The apparatus asrecited in claim 13, wherein the decoder is further configured forscanning and decoding the pixels from the most significant bit-plane tothe least significant bit-plane, and for each bit-plane: a. obtainingthe number of existing groups; b. setting the current group to be afirst group; c. reading a bit from the bitstream; d. if the bit has a“0” value, then reading a second bit from the bitstream and setting thevalue to be the bit value for all pixels in the group in a currentbit-plane; e. if the bit has a “1” value, then for each pixel in thegroup, one bit is read from the bitstream and set to be the bit value ofthat pixel in the current bit-plane, a new group is generated and thenew group is split into the first group and the second group so that thepixels with the “0” value are in the first group and the pixels with the“1” value are in the second group; and f. repeating c-e until the end ofthe current bit-plane is reached.
 15. The apparatus as recited in claim9, wherein the bit budget of each of the blocks is shared between theblocks.
 16. The apparatus as recited in claim 9, wherein the apparatusis selected from the group consisting of a personal computer, a laptopcomputer, a computer workstation, a server, a mainframe computer, ahandheld computer, a personal digital assistant, a cellular/mobiletelephone, a smart appliance, a gaming console, a digital camera, adigital camcorder, a camera phone, an iPod®/iPhone, a video player, aDVD writer/player, a Blu-ray® writer/player, a television and a homeentertainment system.
 17. An apparatus for processing an image with asparse histogram, comprising: a. first processing means configured forprocessing pixels of the image; b. encoding means executable on thefirst processing means for: i. dividing the image into blocks; ii.setting a bit budget for each block; iii. converting pixels of eachblock into binary representations; iv. scanning and encoding the pixelsfrom the most significant bit-plane to the least significant bit-plane;and v. generating a compressed image file of the encoded pixels; and c.storage means coupled to the first processing means, wherein thecompressed image file is stored within the storage means.
 18. Theapparatus as recited in claim 17, wherein encoding means is configuredto scan and encode the pixels at each bit-plane comprises processingeach existing group in the bit-plane, which further comprises: a. if thepixel values of the group all have the same value at the currentbit-plane, writing a first bit value of “0” into a bitstream; and b.writing a second bit value into the bitstream designating the value ofall the pixels in a current group.
 19. The apparatus as recited in claim18, wherein encoding means is configured to scan and encode the pixelscomprising: a. if the pixel values of the group do not all have the samevalue at the current bit-plane, writing the first bit value of “1” intothe bitstream, followed by one bit for each pixel in the current groupdesignating the bit value of that pixel in the current bit-plane; b.generating a new group; and c. splitting the original group into two,retaining pixels with a value “0” in the original group and placingpixels with a value “1” in the new group.
 20. The apparatus as recitedin claim 19, further comprising: a. decoding means executable on thefirst processing means or a second processing means coupled to the firstprocessing means; and b. the decoding means configured to decode thecompressed image file to uncompress the image.
 21. The apparatus asrecited in claim 20: wherein the decoding means comprises a decoderconfigured to decode the compressed image file by scanning and decodingthe pixels from the most significant bit-plane to the least significantbit-plane, and for each bit-plane: a. obtaining the number of existinggroups; b. setting the current group to be a first group; c. reading abit from the bitstream; d. if the bit has a “0” value, then reading asecond bit from the bitstream and setting the value to be the bit valuefor all pixels in the group in a current bit-plane; e. if the bit has a“1” value, then for each pixel in the group, one bit is read from thebitstream and set to be the bit value of that pixel in the currentbit-plane, a new group is generated and the new group is split into thefirst group and the second group so that the pixels with the “0” valueare in the first group and the pixels with the “1” value are in thesecond group; and f. repeating c-e until the end of the currentbit-plane is reached.
 22. The apparatus as recited in claim 17, whereinthe bit budget of each of the blocks is shared between the blocks. 23.The apparatus as recited in claim 17, wherein the apparatus is selectedfrom the group consisting of a personal computer, a laptop computer, acomputer workstation, a server, a mainframe computer, a handheldcomputer, a personal digital assistant, a cellular/mobile telephone, asmart appliance, a gaming console, a digital camera, a digitalcamcorder, a camera phone, an iPod®/iPhone, a video player, a DVDwriter/player, a Blu-ray® writer/player, a television and a homeentertainment system.
 24. An apparatus for processing an image with asparse histogram, comprising: a. a first processor for processing pixelsof the image; b. an encoder executable on the first processor for: i.dividing the image into blocks; ii. setting a bit budget for each block;iii. converting pixels of each block into binary representations; iv.scanning and encoding the pixels from the most significant bit-plane tothe least significant bit-plane; and v. generating a compressed imagefile of the encoded pixels; and c. a storage device coupled to the firstprocessing device, wherein the compressed image file is stored withinthe storage device.
 25. The apparatus as recited in claim 24, whereinthe encoder is configured to scan and encode the pixels comprising: a.writing a first bit value into a bitstream designating that the pixelvalues all have the same value, if the pixel values all have the samevalue; and b. writing a second bit value into the bitstream designatingthe value of all the pixels in a current group.
 26. The apparatus asrecited in claim 25, wherein the encoder is configured to scan andencode the pixels at each bit-plane comprising processing each existinggroup in the bit-plane, which further comprises: a. if the pixel valuesof the group all have the same value at the current bit-plane, writing afirst bit value of “0” into a bitstream; b. writing a second bit valueinto the bitstream designating the value of all the pixels in a currentgroup; c. if the pixel values of the group do not all have the samevalue at the current bit-plane, writing the first bit value of “1” intothe bitstream, followed by one bit for each pixel in the current groupdesignating the bit value of that pixel in the current bit-plane; d.generating a new group; and e. splitting the original group into two,retaining pixels with a value “0” in the original group and placingpixels with a value “1” in the new group.
 27. The apparatus as recitedin claim 26, further comprising: a. a decoder executable on the firstprocessing means or a second processing means coupled to the firstprocessing means; and b. the decoder configured to decode the compressedimage file to uncompress the image.
 28. The apparatus as recited inclaim 27 wherein the decoder is configured to decode the compressedimage file by scanning and decoding the pixels from the most significantbit-plane to the least significant bit-plane, and for each bit-plane: a.obtaining the number of existing groups; b. setting the current group tobe a first group; c. reading a bit from the bitstream; d. if the bit hasa “0” value, then reading a second bit from the bitstream and settingthe value to be the bit value for all pixels in the group in a currentbit-plane; e. if the bit has a “1” value, then for each pixel in thegroup, one bit is read from the bitstream and set to be the bit value ofthat pixel in the current bit-plane, a new group is generated and thenew group is split into the first group and the second group so that thepixels with the “0” value are in the first group and the pixels with the“1” value are in the second group; and f. repeating c-e until the end ofthe current bit-plane is reached.
 29. The apparatus as recited in claim24, wherein the bit budget of each of the blocks is shared between theblocks.
 30. The apparatus as recited in claim 24, wherein the apparatusis selected from the group consisting of a personal computer, a laptopcomputer, a computer workstation, a server, a mainframe computer, ahandheld computer, a personal digital assistant, a cellular/mobiletelephone, a smart appliance, a gaming console, a digital camera, adigital camcorder, a camera phone, an iPod®/iPhone, a video player, aDVD writer/player, a Blu-ray® writer/player, a television and a homeentertainment system.
 31. A network of devices comprising: a. an encoderdevice for encoding an image comprising: i. dividing the image intoblocks; ii. setting a bit budget for each block; iii. converting pixelsof each block into binary representations; iv. scanning and encoding thepixels from the most significant bit-plane to the least significantbit-plane; and v. generating a compressed image file of the encodedpixels; and b. a decoder device for decoding the compressed image filecomprising scanning and decoding the pixels from the most significantbit-plane to the least significant bit-plane, and for each bit-plane: i.obtaining a number of existing groups; ii. setting a current group to bea first group; iii. reading a bit from a bitstream; iv. if the bit has a“0” value, then reading a second bit from the bitstream and setting thevalue to be the bit value for all pixels in the group in a currentbit-plane; v. if the bit has a “1” value, then for each pixel in thegroup, one bit is read from the bitstream and set to be the bit value ofthat pixel in the current bit-plane, a new group is generated and thenew group is split into the first group and the second group so that thepixels with the “0” value are in the first group and the pixels with the“1” value are in the second group; and vi. repeating iii-v until the endof the current bit-plane is reached.
 32. The apparatus as recited inclaim 31, wherein the encoder device is configured to scan and encodethe pixels at each bit-plane comprising processing each existing groupin the bit-plane, which further comprises: a. if the pixel values of thegroup all have the same value at the current bit-plane, writing a firstbit value of “0” into a bitstream; b. writing a second bit value intothe bitstream designating the value of all the pixels in a currentgroup.
 33. The apparatus as recited in claim 32, wherein the encoderdevice is configured to scan and encode the pixels comprising: a. if thepixel values of the group do not all have the same value at the currentbit-plane, writing the first bit value of “1” into the bitstream,followed by one bit for each pixel in the current group designating thebit value of that pixel in the current bit-plane; b. generating a newgroup; and c. splitting the original group into two, retaining pixelswith a value “0” in the original group and placing pixels with a value“1” in the new group.
 34. The apparatus as recited in claim 33, whereinthe bit budget of each of the blocks is shared between the blocks.